package com.foreveross.eimpc.web.test;

import java.util.Map;

import org.msgpack.MessagePack;
import org.msgpack.template.Templates;
import org.msgpack.type.Value;

public class MsgPackInt2Byte {
	public static void main(String[] args)throws Exception{
		
		int[] ints = new int[]{130, 164, 110, 97, 109, 101, 167, 102, 106, 115, 100, 102, 106, 108, 167, 99, 111, 110, 116, 101, 110, 116, 173, 72, 101, 108, 108, 111, 44, 32, 87, 111, 114, 108, 100, 33};
		
		
		//byte数组内容。websocket发送的msgpack内容。
		//[-127, -2, 0, -120, 127, -66, -11, 37, 78, -115, -59, 9, 78, -120, -63, 9, 78, -113, -59, 9, 70, -119, -39, 20, 79, -121, -39, 20, 79, -113, -39, 20, 73, -119, -39, 20, 79, -116, -39, 20, 79, -120, -39, 20, 78, -117, -39, 20, 79, -114, -39, 20, 79, -116, -39, 20, 79, -120, -39, 20, 79, -122, -39, 20, 73, -119, -39, 28, 70, -110, -60, 20, 78, -110, -60, 20, 79, -110, -60, 20, 73, -110, -60, 21, 78, -110, -60, 20, 79, -110, -60, 20, 73, -110, -60, 18, 76, -110, -62, 23, 83, -113, -59, 20, 83, -113, -59, 29, 83, -113, -59, 29, 83, -113, -60, 20, 83, -118, -63, 9, 76, -116, -39, 29, 72, -110, -60, 20, 78, -110, -60, 20, 75, -110, -60, 21, 71, -110, -60, 21, 79, -110, -58, 22]
		byte[] byts  =new byte[ints.length]; 
		
		for(int j=0;j<byts.length;j++){
			byts[j] = (byte)ints[j]; 
			System.out.println(byts[j]);
		}
		
		 byte[] b = new byte[]{ 49, 51, 48, 44, 49, 54, 52, 44, 49, 49, 48, 44, 57, 55, 44, 49, 48, 57, 44, 49, 48, 49, 44, 49, 54, 55, 44, 49, 48, 50, 44, 49, 48, 54, 44, 49, 49, 53, 44, 49, 48, 48, 44, 49, 48, 50, 44, 49, 48, 54, 44, 49, 48, 56, 44, 49, 54, 55, 44, 57, 57, 44, 49, 49, 49, 44, 49, 49, 48, 44, 49, 49, 54, 44, 49, 48, 49, 44, 49, 49, 48, 44, 49, 49, 54, 44, 49, 55, 51, 44, 55, 50, 44, 49, 48, 49, 44, 49, 48, 56, 44, 49, 48, 56, 44, 49, 49, 49, 44, 52, 52, 44, 51, 50, 44, 56, 55, 44, 49, 49, 49, 44, 49, 49, 52, 44, 49, 48, 56, 44, 49, 48, 48, 44, 51, 51};
		   MessagePack msgpack = new MessagePack();
			Map<String, Value> vMap;
			vMap = msgpack.read(b,Templates.tMap(Templates.TString, Templates.TValue));
			System.out.println(vMap.toString());
	}
}
